#pragma once
#ifndef _KLAS_GL_SHADER_PROGRAM_HPP_
#define _KLAS_GL_SHADER_PROGRAM_HPP_

#include "../ShaderProgram.hpp"
#include "../Shader.hpp"
#include "../../GLLibs.hpp"

#include <map>
using std::map;

namespace klas
{
  namespace graphics
  {
    namespace gl
    {
      class GLShaderProgram: public library::Gl, public ShaderProgram
      {
      public:
        GLShaderProgram();
        virtual ~GLShaderProgram();

        virtual void attach(Shader* shader);
        virtual void deattach(Shader* shader);
        virtual void link();
        virtual void enable();
        virtual void disable();

        virtual uint32 setVariable(string name, double v0);
        virtual uint32 setVariable(string name, double v0, double v1);
        virtual uint32 setVariable(string name, double v0, double v1, double v2);
        virtual uint32 setVariable(string name, double v0, double v1, double v2, double v3);
        virtual uint32 setVariable(string name, uint8 elementCount, int totalElements, double* arr);

        virtual uint32 setVariable(uint32 id, double v0);
        virtual uint32 setVariable(uint32 id, double v0, double v1);
        virtual uint32 setVariable(uint32 id, double v0, double v1, double v2);
        virtual uint32 setVariable(uint32 id, double v0, double v1, double v2, double v3);
        virtual uint32 setVariable(uint32 id, uint8 elementCount, int totalElements, double* arr);

        virtual uint32 getID(string name);

      private:
        GLuint m_programID;
        map<string, GLuint> m_data;

      };
    }
  }
}

#endif